<template>
    <div>
        <el-select v-model="value" placeholder="Select" @change="selectChange">
            <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
            </el-option>
        </el-select>
        <el-select v-model="value1" placeholder="Select">
            <el-option
                    v-for="item in options1"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
            </el-option>
        </el-select>
    </div>
</template>
<script>
import {loadTableData} from "./request";
export default {
    name: "",
    data() {
        return {
            options: [
            {
                value: 1,
                label: '一般设备'
            }, {
                value: 2,
                label: '特种设备'
            }],
            value: '',
            options1: [{
                value: 'Option1',
                label: 'Option1'
            }, {
                value: 'Option2',
                label: 'Option2'
            }, {
                value: 'Option3',
                label: 'Option3'
            }, {
                value: 'Option4',
                label: 'Option4'
            }, {
                value: 'Option5',
                label: 'Option5'
            }],
            value1: ''
        }
    },
    methods: {
        selectChange() {
            let params = {
                url: '/deviceManager/getList',
                method: 'POST',
                currentPage: 1,
                pageSize: 999,
                data: { deviceType: this.value }
            }
            loadTableData(params).then(response => {
                console.log(response)
            }).catch(err => {
                console.log(err)
            })
        }
    }
}
</script>
<style scoped lang="scss">
</style>